#!/usr/bin/env python
# -*- coding: UTF-8 -*-

'''
Copyright (C) 2010 dbzhang800@gmail.com
All rights reserved.
'''

from pyqt4_pyside import *

class LogWidget(QtGui.QPlainTextEdit):
    def __init__(self, parent=None):
        super(LogWidget, self).__init__(parent)
        self.setMaximumBlockCount(1000)
        self.setCenterOnScroll(True)
        
    def addLogString(self, msg):
        self.appendHtml(msg)
        
    def addErrorString(self,  msg):
        self.appendHtml(u"<font color=red>{}</font>".format(msg))
